home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / StandardFile.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  7.0 KB  |  256 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        StandardFile.a
  3. ;
  4. ;    Contains:    Standard File package Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__STANDARDFILE__') = 'UNDEFINED' THEN
  21. __STANDARDFILE__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  30.     include 'Dialogs.a'
  31.     ENDIF
  32. ;        include 'Errors.a'                                            ;
  33. ;        include 'Memory.a'                                            ;
  34. ;            include 'MixedMode.a'                                    ;
  35. ;        include 'Windows.a'                                        ;
  36. ;            include 'Quickdraw.a'                                    ;
  37. ;                include 'QuickdrawText.a'                            ;
  38. ;            include 'Events.a'                                        ;
  39. ;                include 'OSUtils.a'                                ;
  40. ;            include 'Controls.a'                                    ;
  41. ;                include 'Menus.a'                                    ;
  42. ;        include 'TextEdit.a'                                        ;
  43.  
  44.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  45.     include 'Files.a'
  46.     ENDIF
  47.  
  48. ; resource IDs and item offsets of pre-7.0 dialogs 
  49. putDlgID                        EQU        -3999
  50. putSave                            EQU        1
  51. putCancel                        EQU        2
  52. putEject                        EQU        5
  53. putDrive                        EQU        6
  54. putName                            EQU        7
  55. getDlgID                        EQU        -4000
  56. getOpen                            EQU        1
  57. getCancel                        EQU        3
  58. getEject                        EQU        5
  59. getDrive                        EQU        6
  60. getNmList                        EQU        7
  61. getScroll                        EQU        8
  62. ; resource IDs and item offsets of 7.0 dialogs 
  63. sfPutDialogID                    EQU        -6043
  64. sfGetDialogID                    EQU        -6042
  65. sfItemOpenButton                EQU        1
  66. sfItemCancelButton                EQU        2
  67. sfItemBalloonHelp                EQU        3
  68. sfItemVolumeUser                EQU        4
  69. sfItemEjectButton                EQU        5
  70.  
  71. sfItemDesktopButton                EQU        6
  72. sfItemFileListUser                EQU        7
  73. sfItemPopUpMenuUser                EQU        8
  74. sfItemDividerLinePict            EQU        9
  75. sfItemFileNameTextEdit            EQU        10
  76. sfItemPromptStaticText            EQU        11
  77. sfItemNewFolderUser                EQU        12
  78. ; pseudo-item hits for use in DlgHook 
  79. sfHookFirstCall                    EQU        -1
  80. sfHookCharOffset                EQU        $1000
  81. sfHookNullEvent                    EQU        100
  82. sfHookRebuildList                EQU        101
  83. sfHookFolderPopUp                EQU        102
  84. sfHookOpenFolder                EQU        103
  85. ; the following are only in system 7.0+ 
  86. sfHookOpenAlias                    EQU        104
  87. sfHookGoToDesktop                EQU        105
  88. sfHookGoToAliasTarget            EQU        106
  89. sfHookGoToParent                EQU        107
  90. sfHookGoToNextDrive                EQU        108
  91. sfHookGoToPrevDrive                EQU        109
  92. sfHookChangeSelection            EQU        110
  93.  
  94. sfHookSetActiveOffset            EQU        200
  95. sfHookLastCall                    EQU        -2
  96.  
  97. ; the refcon field of the dialog record during a
  98. ; modalfilter or dialoghook contains one of the following 
  99. sfMainDialogRefCon                EQU        'stdf'
  100. sfNewFolderDialogRefCon            EQU        'nfdr'
  101. sfReplaceDialogRefCon            EQU        'rplc'
  102. sfStatWarnDialogRefCon            EQU        'stat'
  103. sfLockWarnDialogRefCon            EQU        'lock'
  104. sfErrorDialogRefCon                EQU        'err '
  105.  
  106. SFReply                 RECORD    0
  107. good                     ds.b   1        ; offset: $0 (0)
  108. copy                     ds.b   1        ; offset: $1 (1)
  109. fType                     ds.l   1        ; offset: $2 (2)
  110. vRefNum                     ds.w   1        ; offset: $6 (6)
  111. version                     ds.w   1        ; offset: $8 (8)
  112. fName                     ds.l   16        ; offset: $A (10)
  113. sizeof                     EQU *            ; size:   $4A (74)
  114.                         ENDR
  115.  
  116. ; typedef struct SFReply     SFReply
  117. StandardFileReply         RECORD    0
  118. sfGood                     ds.b   1        ; offset: $0 (0)
  119. sfReplacing                 ds.b   1        ; offset: $1 (1)
  120. sfType                     ds.l   1        ; offset: $2 (2)
  121. sfFile                     ds     FSSpec    ; offset: $6 (6)
  122. sfScript                 ds.w   1        ; offset: $4C (76)
  123. sfFlags                     ds.w   1        ; offset: $4E (78)
  124. sfIsFolder                 ds.b   1        ; offset: $50 (80)
  125. sfIsVolume                 ds.b   1        ; offset: $51 (81)
  126. sfReserved1                 ds.l   1        ; offset: $52 (82)
  127. sfReserved2                 ds.w   1        ; offset: $56 (86)
  128. sizeof                     EQU *            ; size:   $58 (88)
  129.                         ENDR
  130.  
  131. ; typedef struct StandardFileReply  StandardFileReply
  132. ; for CustomXXXFile, ActivationOrderListPtr parameter is a pointer to an array of item numbers 
  133. ; typedef const short         *ActivationOrderListPtr
  134. ; the following also include an extra parameter of "your data pointer" 
  135. ; typedef OSType             SFTypeList[4]
  136. ;
  137. ;    The GetFile "typeList" parameter type has changed from "SFTypeList" to "ConstSFTypeListPtr".
  138. ;    For C, this will add "const" and make it an in-only parameter.
  139. ;    For Pascal, this will require client code to use the @ operator, but make it easier to specify long lists.
  140. ;
  141. ;    ConstSFTypeListPtr is a pointer to an array of OSTypes.
  142. ;
  143. ; typedef const OSType         *ConstSFTypeListPtr
  144. ;
  145. ; pascal void SFPutFile(Point where, ConstStr255Param prompt, ConstStr255Param origName, DlgHookUPP dlgHook, SFReply *reply)
  146. ;
  147.     IF ¬ GENERATINGCFM THEN
  148.         Macro
  149.         _SFPutFile
  150.             move.w    #$0001,-(sp)
  151.             dc.w     $A9EA
  152.         EndM
  153.     ELSE
  154.         IMPORT_CFM_FUNCTION    SFPutFile
  155.     ENDIF
  156.  
  157. ;
  158. ; pascal void SFGetFile(Point where, ConstStr255Param prompt, FileFilterUPP fileFilter, short numTypes, ConstSFTypeListPtr typeList, DlgHookUPP dlgHook, SFReply *reply)
  159. ;
  160.     IF ¬ GENERATINGCFM THEN
  161.         Macro
  162.         _SFGetFile
  163.             move.w    #$0002,-(sp)
  164.             dc.w     $A9EA
  165.         EndM
  166.     ELSE
  167.         IMPORT_CFM_FUNCTION    SFGetFile
  168.     ENDIF
  169.  
  170. ;
  171. ; pascal void SFPPutFile(Point where, ConstStr255Param prompt, ConstStr255Param origName, DlgHookUPP dlgHook, SFReply *reply, short dlgID, ModalFilterUPP filterProc)
  172. ;
  173.     IF ¬ GENERATINGCFM THEN
  174.         Macro
  175.         _SFPPutFile
  176.             move.w    #$0003,-(sp)
  177.             dc.w     $A9EA
  178.         EndM
  179.     ELSE
  180.         IMPORT_CFM_FUNCTION    SFPPutFile
  181.     ENDIF
  182.  
  183. ;
  184. ; pascal void SFPGetFile(Point where, ConstStr255Param prompt, FileFilterUPP fileFilter, short numTypes, ConstSFTypeListPtr typeList, DlgHookUPP dlgHook, SFReply *reply, short dlgID, ModalFilterUPP filterProc)
  185. ;
  186.     IF ¬ GENERATINGCFM THEN
  187.         Macro
  188.         _SFPGetFile
  189.             move.w    #$0004,-(sp)
  190.             dc.w     $A9EA
  191.         EndM
  192.     ELSE
  193.         IMPORT_CFM_FUNCTION    SFPGetFile
  194.     ENDIF
  195.  
  196. ;
  197. ; pascal void StandardPutFile(ConstStr255Param prompt, ConstStr255Param defaultName, StandardFileReply *reply)
  198. ;
  199.     IF ¬ GENERATINGCFM THEN
  200.         Macro
  201.         _StandardPutFile
  202.             move.w    #$0005,-(sp)
  203.             dc.w     $A9EA
  204.         EndM
  205.     ELSE
  206.         IMPORT_CFM_FUNCTION    StandardPutFile
  207.     ENDIF
  208.  
  209. ;
  210. ; pascal void StandardGetFile(FileFilterUPP fileFilter, short numTypes, ConstSFTypeListPtr typeList, StandardFileReply *reply)
  211. ;
  212.     IF ¬ GENERATINGCFM THEN
  213.         Macro
  214.         _StandardGetFile
  215.             move.w    #$0006,-(sp)
  216.             dc.w     $A9EA
  217.         EndM
  218.     ELSE
  219.         IMPORT_CFM_FUNCTION    StandardGetFile
  220.     ENDIF
  221.  
  222. ;
  223. ; pascal void CustomPutFile(ConstStr255Param prompt, ConstStr255Param defaultName, StandardFileReply *reply, short dlgID, Point where, DlgHookYDUPP dlgHook, ModalFilterYDUPP filterProc, ActivationOrderListPtr activeList, ActivateYDUPP activate, void *yourDataPtr)
  224. ;
  225.     IF ¬ GENERATINGCFM THEN
  226.         Macro
  227.         _CustomPutFile
  228.             move.w    #$0007,-(sp)
  229.             dc.w     $A9EA
  230.         EndM
  231.     ELSE
  232.         IMPORT_CFM_FUNCTION    CustomPutFile
  233.     ENDIF
  234.  
  235. ;
  236. ; pascal void CustomGetFile(FileFilterYDUPP fileFilter, short numTypes, ConstSFTypeListPtr typeList, StandardFileReply *reply, short dlgID, Point where, DlgHookYDUPP dlgHook, ModalFilterYDUPP filterProc, ActivationOrderListPtr activeList, ActivateYDUPP activate, void *yourDataPtr)
  237. ;
  238.     IF ¬ GENERATINGCFM THEN
  239.         Macro
  240.         _CustomGetFile
  241.             move.w    #$0008,-(sp)
  242.             dc.w     $A9EA
  243.         EndM
  244.     ELSE
  245.         IMPORT_CFM_FUNCTION    CustomGetFile
  246.     ENDIF
  247.  
  248. ;
  249. ; pascal OSErr StandardOpenDialog(StandardFileReply *reply)
  250. ;
  251.     IF GENERATINGCFM THEN
  252.         IMPORT_CFM_FUNCTION    StandardOpenDialog
  253.     ENDIF
  254.  
  255.     ENDIF ; __STANDARDFILE__
  256.